]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
style: Fix brace style
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Jan 2019 21:02:57 +0000 (22:02 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 1 Jul 2019 21:44:11 +0000 (23:44 +0200)
Opening braces should be on the same line as the associated statement,
and only be omitted if both surrounding blocks are one-liners.

Partially spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

15 files changed:
js/misc/util.js
js/ui/altTab.js
js/ui/background.js
js/ui/calendar.js
js/ui/components/networkAgent.js
js/ui/dnd.js
js/ui/iconGrid.js
js/ui/lookingGlass.js
js/ui/magnifier.js
js/ui/magnifierDBus.js
js/ui/popupMenu.js
js/ui/screenshot.js
js/ui/status/network.js
js/ui/tweener.js
js/ui/windowManager.js

index a5ad0b0a28edbc45eaae421f77304e3ebb50d7f9..9fd31256e9abe752b298259bdaf05c9d18caf213 100644 (file)
@@ -103,8 +103,7 @@ function spawnApp(argv) {
 //
 // Runs @argv in the background. If launching @argv fails,
 // this will throw an error.
-function trySpawn(argv)
-{
+function trySpawn(argv) {
     var success, pid;
     try {
         [success, pid] = GLib.spawn_async(null, argv, null,
index c7b175df242532b4785637e612cd41d17768b59e..83e26cf8a420e309ac8796eada344305afdd714b 100644 (file)
@@ -795,8 +795,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
                                                             return GLib.SOURCE_REMOVE;
                                                         });
             GLib.Source.set_name_by_id(this._mouseTimeOutId, '[gnome-shell] this._enterItem');
-        } else
+        } else {
            this._itemEntered(index);
+        }
     }
 
     _enterItem(index) {
index 6ce0d6093c8decb93c1cc69c033eab539b5d2f03..592b9498de97c45dfe898a5dc965982994c25709 100644 (file)
@@ -464,9 +464,9 @@ var Background = class Background {
 
         let cache = Meta.BackgroundImageCache.get_default();
         let image = cache.load(file);
-        if (image.is_loaded())
+        if (image.is_loaded()) {
             this._setLoaded();
-        else {
+        } else {
             let id = image.connect('loaded', () => {
                 this._setLoaded();
                 image.disconnect(id);
index bcd28d784ff135f2fad6f27912572615e014e159..e253f84699108e0b52373c1ed2270f9c9f2517a2 100644 (file)
@@ -143,8 +143,7 @@ function _datesEqual(a, b) {
     return true;
 }
 
-function _dateIntervalsOverlap(a0, a1, b0, b1)
-{
+function _dateIntervalsOverlap(a0, a1, b0, b1) {
     if (a1 <= b0)
         return false;
     else if (b1 <= a0)
@@ -466,8 +465,7 @@ var Calendar = class Calendar {
                 let day = 32 - new Date(newDate.getFullYear() - 1, 11, 32).getDate();
                 newDate = new Date(newDate.getFullYear() - 1, 11, day);
             }
-        }
-        else {
+        } else {
             newDate.setMonth(oldMonth - 1);
             if (newDate.getMonth() != oldMonth - 1) {
                 let day = 32 - new Date(newDate.getFullYear(), oldMonth - 1, 32).getDate();
@@ -490,8 +488,7 @@ var Calendar = class Calendar {
                 let day = 32 - new Date(newDate.getFullYear() + 1, 0, 32).getDate();
                 newDate = new Date(newDate.getFullYear() + 1, 0, day);
             }
-        }
-        else {
+        } else {
             newDate.setMonth(oldMonth + 1);
             if (newDate.getMonth() != oldMonth + 1) {
                 let day = 32 - new Date(newDate.getFullYear(), oldMonth + 1, 32).getDate();
@@ -646,9 +643,9 @@ var Calendar = class Calendar {
                 button.add_style_pseudo_class('selected');
                 if (this._shouldDateGrabFocus)
                     button.grab_key_focus();
-            }
-            else
+            } else {
                 button.remove_style_pseudo_class('selected');
+            }
         });
     }
 };
index a66331385911d401856f9d1dc90763490c247035..4c57e785a5f13e24b43589713e803e89749034a7 100644 (file)
@@ -80,8 +80,9 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
                         secret.valid = secret.value.length > 0;
                     this._updateOkButton();
                 });
-            } else
+            } else {
                 secret.valid = true;
+            }
 
             if (rtl) {
                 layout.attach(secret.entry, 0, pos, 1, 1);
@@ -188,8 +189,9 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
                           || (value[i] >= 'A' && value[i] <= 'Z')))
                         return false;
                 }
-            } else
+            } else {
                 return false;
+            }
        } else if (secret.wep_key_type == NM.WepKeyType.PASSPHRASE) {
            if (value.length < 0 || value.length > 64)
                return false;
@@ -458,8 +460,9 @@ var VPNRequestHandler = class {
                 this._agent.respond(this._requestId, Shell.NetworkAgentResponse.USER_CANCELED);
             else
                 this._agent.respond(this._requestId, Shell.NetworkAgentResponse.CONFIRMED);
-        } else
+        } else {
             this._agent.respond(this._requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
+        }
 
         this.destroy();
     }
index 37e48cb41297f327ac71713432f01d38cd532b01..3f533e9af56f0a67c944f1d9306422c02b21a56b 100644 (file)
@@ -588,8 +588,9 @@ var _Draggable = class _Draggable {
                         if (this._restoreOnSuccess) {
                             this._restoreDragActor(event.get_time());
                             return true;
-                        } else
+                        } else {
                             this._dragActor.destroy();
+                        }
                     }
 
                     this._dragState = DragState.INIT;
index 20a27f94d95e81dbdb19613cd6d31dc44ef61204..44ccf4dd75651ec3dba82d5adc00346817cc4863 100644 (file)
@@ -834,8 +834,9 @@ var PaginatedIconGrid = GObject.registerClass({
                 if ((i + 1) % this._childrenPerPage == 0)
                     y +=  this._spaceBetweenPages - spacing + this.bottomPadding + this.topPadding;
                 x = box.x1 + leftEmptySpace + this.leftPadding;
-            } else
+            } else {
                 x += this._getHItemSize() + spacing;
+            }
         }
     }
 
index b51365fcb105dabfdf2d558fcc79b6675145079d..4e5b988ba868df43bcb09a6c3e3c7a2f2d2e90bb 100644 (file)
@@ -185,9 +185,9 @@ var Notebook = class Notebook {
     }
 
     selectChild(child) {
-        if (child == null)
+        if (child == null) {
             this.selectIndex(-1);
-        else {
+        } else {
             for (let i = 0; i < this._tabs.length; i++) {
                 let tabData = this._tabs[i];
                 if (tabData.child == child) {
index 22517d55a3ac0a452b70f088ada520830516cea8..9e857f1a255ffbb77c241af2d5cae893a3dc1944 100644 (file)
@@ -347,8 +347,7 @@ var Magnifier = class Magnifier {
             if (!this._crossHairs)
                 this.addCrosshairs();
             this._crossHairs.show();
-        }
-        else {
+        } else {
             if (this._crossHairs)
                 this._crossHairs.hide();
         }
@@ -375,9 +374,9 @@ var Magnifier = class Magnifier {
         if (this._crossHairs) {
             let clutterColor = this._crossHairs.getColor();
             return clutterColor.to_string();
-        }
-        else
+        } else {
             return '#00000000';
+        }
     }
 
     /**
@@ -457,8 +456,7 @@ var Magnifier = class Magnifier {
         if (clip) {
             if (this._crossHairs)
                 this._crossHairs.setClip(CROSSHAIRS_CLIP_SIZE);
-        }
-        else {
+        } else {
             // Setting no clipping on crosshairs means a zero sized clip
             // rectangle.
             if (this._crossHairs)
@@ -475,9 +473,9 @@ var Magnifier = class Magnifier {
         if (this._crossHairs) {
             let [clipWidth, clipHeight] = this._crossHairs.getClip();
             return (clipWidth > 0 && clipHeight > 0);
-        }
-        else
+        } else {
             return false;
+        }
      }
 
     //// Private methods ////
@@ -1458,11 +1456,9 @@ var ZoomRegion = class ZoomRegion {
 
         if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PROPORTIONAL) {
             return this._centerFromPointProportional(xMouse, yMouse);
-        }
-        else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH) {
+        } else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH) {
             return this._centerFromPointPush(xMouse, yMouse);
-        }
-        else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED) {
+        } else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED) {
             return this._centerFromPointCentered(xMouse, yMouse);
         }
 
@@ -1776,8 +1772,7 @@ var Crosshairs = class Crosshairs {
             // mouse.
             this._clipSize = size;
             this.reCenter();
-        }
-        else {
+        } else {
             // Restore the missing chunk.
             this._clipSize = [0, 0];
             this.reCenter();
index e26724544c04798fd53d5f1e8cd0534914cfd613..2449cf8b93e31b54575bf51e4fbc0bdaea887025 100644 (file)
@@ -106,9 +106,9 @@ var ShellMagnifier = class ShellMagnifier {
         if (proxyAndZoomRegion && proxyAndZoomRegion.zoomRegion) {
             Main.magnifier.addZoomRegion(proxyAndZoomRegion.zoomRegion);
             return true;
-        }
-        else
+        } else {
             return false;
+        }
     }
 
     /**
index 5c672d5e28be4429efe3f1dd7a38b5515389d94a..0cd0a0a84185420b51eaa57504af7f9ceee9dcce 100644 (file)
@@ -851,8 +851,9 @@ var PopupMenu = class extends PopupMenuBase {
                 this.toggle();
             this.actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
             return Clutter.EVENT_STOP;
-        } else
+        } else {
             return Clutter.EVENT_PROPAGATE;
+        }
     }
 
     setArrowOrigin(origin) {
index 664bcfa4e482f8b9c0a2a576a88a7da03366a4df..d7433ba90618fe56346f2a626bf7c903f0fe994e 100644 (file)
@@ -72,9 +72,9 @@ var ScreenshotService = class {
                 flashspot.fire(() => {
                     this._removeShooterForSender(invocation.get_sender());
                 });
-            }
-            else
+            } else {
                 this._removeShooterForSender(invocation.get_sender());
+            }
         }
 
         let retval = GLib.Variant.new('(bs)', [result, filenameUsed]);
index bac124d85f9139ca8f9ba70d2622f2039185ecac..67cacba548beff82a8e7c2f75b711076906e9925 100644 (file)
@@ -498,8 +498,9 @@ var NMDeviceWired = class extends NMConnectionDevice {
             } else {
                 return 'network-wired-disconnected-symbolic';
             }
-        } else
+        } else {
             return 'network-wired-disconnected-symbolic';
+        }
     }
 };
 
index ceff456a1013773ab685a96b3d9b84ed4861e8c9..b4f7a8bcd09f6ce5046da52868717879693f5ad2 100644 (file)
@@ -85,8 +85,9 @@ function _addHandler(target, params, name, handler) {
             oldHandler.apply(eventScope, oldParams);
             handler(target);
         };
-    } else
+    } else {
         params[name] = () => { handler(target); };
+    }
 }
 
 function _actorDestroyed(target) {
@@ -116,8 +117,9 @@ function removeTweens(...args) {
         if (Tweener.getTweenCount(scope) == 0)
             _tweenCompleted(scope);
         return true;
-    } else
+    } else {
         return false;
+    }
 }
 
 function pauseTweens(...args) {
index f8ea86f74c460c8db53f088570b10b1bd1bec68f..398defd3507eea193e1596f5d7f46d7f5ec6942e 100644 (file)
@@ -630,9 +630,9 @@ var AppSwitchAction = GObject.registerClass({
             // Check whether the 4th finger press happens after a 3-finger long press,
             // this only needs to be checked on the first 4th finger press
             if (this._longPressStartTime != null &&
-                event.get_time() < this._longPressStartTime + LONG_PRESS_TIMEOUT)
+                event.get_time() < this._longPressStartTime + LONG_PRESS_TIMEOUT) {
                 this.cancel();
-            else {
+            } else {
                 this._longPressStartTime = null;
                 this.emit('activated');
             }
@@ -1183,9 +1183,9 @@ var WindowManager = class {
         let focusWindow = global.display.focus_window;
         let nextWindow;
 
-        if (focusWindow == null)
+        if (focusWindow == null) {
             nextWindow = windows[0].metaWindow;
-        else {
+        } else {
             let index = this._lookupIndex (windows, focusWindow) + 1;
 
             if (index >= windows.length)